function init() {
	_initHeader();
	
	$("#editButton").unbind("click");
	$("#editButton").click(clickedEditButton);
	
	commonProgress("Searching Contacts..", false, null, "grey");
	contact.get(navigation.parameters.contactId, getContactSuccessCallback, getContactErrorCallback);
}

function clickedEditButton() {
	var navigationRule = {
		"pageId" : "contact_update",
		"parameters" : {
			"contactId" : navigation.parameters.contactId
		}
	};
	
	navigation.navigate(navigationRule);
}

function getContactSuccessCallback(contactInfo) {
	if(contactInfo.firstName != "" || contactInfo.firstName != undefined || contactInfo.firstName != null)
		$("#firstName").val(contactInfo.firstName);
	
	if(contactInfo.lastName != "" || contactInfo.lastName != undefined || contactInfo.lastName != null)
		$("#lastName").val(contactInfo.lastName);
	
	if(contactInfo.mobilePhone != "" || contactInfo.mobilePhone != undefined || contactInfo.mobilePhone != null)
		$("#mobilePhone").val(contactInfo.mobilePhone);
	
	if(contactInfo.workPhone != "" || contactInfo.workPhone != undefined || contactInfo.workPhone != null)
		$("#workPhone").val(contactInfo.workPhone);
	
	if(contactInfo.email != "" || contactInfo.email != undefined || contactInfo.email != null) {
		$("#email").val(contactInfo.email);
	}
	
	if(contactInfo.organization != "" || contactInfo.organization != undefined || contactInfo.organization != null) {
		$("#organization").val(contactInfo.organization);
	}
	
	if(contactInfo.department != "" || contactInfo.department != undefined || contactInfo.department != null) {
		$("#department").val(contactInfo.department);
	}
	
	if(contactInfo.jobTitle != "" || contactInfo.jobTitle != undefined || contactInfo.jobTitle != null) {
		$("#jobTitle").val(contactInfo.jobTitle);
	}
	
	platformUIComponent.dismissProgressDialog();
}

function getContactErrorCallback(errorMessage) {
	notifyError("getContact", errorMessage);
}

function onScreenBack() {
	log.log("onScreenBack on conatct_detaiil page is called.");
}